package com.code.soulnetty.modbus.client;

import io.netty.channel.EventLoopGroup;
import lombok.Getter;
import lombok.Setter;

/**
 * @author lyf
 * @date 2022-12-17 0:04
 */
@Getter
@Setter
public class NettyConfig {

    /**
     * 线程池
     */
    private EventLoopGroup eventLoopGroup;

    /**
     * 名称
     */
    private String name;

    /**
     * 连接超时时间
     */
    private int connectTimeout;

    /**
     * 后台日志
     */
    private boolean backLog;

    /**
     * 发送缓冲区大小
     */
    private int sendBuf;

    /**
     * 接收缓冲区大小
     */
    private int rcvBuf;

    public NettyConfig(EventLoopGroup eventLoopGroup, String name, int connectTimeout) {
        this(eventLoopGroup, name, connectTimeout, Boolean.FALSE);
    }

    public NettyConfig(EventLoopGroup eventLoopGroup, String name, int connectTimeout, boolean backLog) {
        this.eventLoopGroup = eventLoopGroup;
        this.name = name;
        this.connectTimeout = connectTimeout;
        this.backLog = backLog;
    }
}
